from gabor import get_fetures_from_image
from fppkpca import *
import numpy as np
import commands

if __name__ == "__main__":
    train_list = commands.getoutput("ls -1 data/train/*.png").split()
    matrix = []
    for item in train_list:
        matrix.append(np.array(get_fetures_from_image(item)))
    train_matrix = np.array(matrix)
    
#     kpca = FppKPCA(n_components=15)
#     X_kpca = kpca.fit_transform(train_matrix)
#     
    kpca2 = Kpca(np.array([[5,3,2,1],[15,10,1,1],[9,2,1,2],[9,5,3,2]]), FractionalPowerPolymonial(), 2)
    kpca2.run()
    X_kpca2 = kpca2.projected_data()
    print X_kpca2